import express from 'express';
import { authGuard } from '../auth/auth.middleware';
import * as paymentController from './order.controller';

const router = express.Router();

/**
 * 支付
 */
router.post('/payments', authGuard, paymentController.payment);
// router.post('/payments', paymentController.payment);

/**
 * 支付通知
 */
router.post('/paymentNotify', paymentController.notify);

/**
 * 获取订单
 */
router.get('/getOrder', paymentController.orders);

/**
 * 按关键字查询（模糊查询）
 */
router.get('/getOrderByKey', paymentController.selectByKey);

/**
 * 获取价格
 */
router.get('/targetPrices', paymentController.target_prices);

/**
 * 添加类目价格
 */
router.post('/addTargetPrice', authGuard, paymentController.storeTargetPrice);

/**
 * 更新类目价格
 */
router.post('/updateTargetPrice', authGuard, paymentController.updateTarget);

/**
 * 删除类目价格
 */
router.post('/delTargetPrice', authGuard, paymentController.destroyTargetPrice);

/**
 * 导出路由
 */
export default router;